
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.team1160.beta.season2011.output;

import com.team1160.beta.season2011.output.drivetrain.DriveTrain;
import com.team1160.beta.season2011.output.drivetrain.DriveTrainCommand;
import com.team1160.beta.season2011.output.kicker.Kicker;
import com.team1160.beta.season2011.output.kicker.KickerCommand;
import com.team1160.beta.season2011.processing.RobotCommand;

/**
 * This class takes in a a RoboDecision and passes individual commands to the
 * drivetrain and kicker.
 * @author CJ
 */
public class OutputManager {
    DriveTrain driveTrain;
    Kicker kicker;

    public OutputManager(int frontleft,int frontright, int backleft, int backright,
            int kfront,int kback, int lfront, int lback) {
        driveTrain=new DriveTrain(frontleft,frontright,backleft,backright);
        kicker=new Kicker(kfront,kback,lfront,lback);
    }

    public void output(RobotCommand command){
        kicker.kick(new KickerCommand(
                command.get(KickerCommand.KICKER)!=0,
                command.get(KickerCommand.LATCH)!=0));
        driveTrain.drive(new DriveTrainCommand(
                command.get(DriveTrainCommand.JOYSTICK_Y_AXIS),
                command.get(DriveTrainCommand.JOYSTICK_Z_AXIS)));
    }


}
